package com.test.designPattern.structuralType.facadePattern;

import lombok.extern.slf4j.Slf4j;

/**
 * 门面类Facade
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/4/7
 */
@Slf4j
public class Computer {

    private CPU cpu;
    private Disk disk;
    private Memory memory;

    public Computer(){
        cpu = new CPU();
        memory = new Memory();
        disk = new Disk();
    }

    public void start(){
        log.info("Computer start begin");
        cpu.start();
        disk.start();
        memory.start();
        log.info("Computer start end");
    }

    public void shutDown(){
        log.info("Computer shutDown begin");
        cpu.shutDown();
        disk.shutDown();
        memory.shutDown();
        log.info("Computer shutDown end");
    }
}
